//
//  LoginView.m
//  Exam14-1
//
//  Created by 孙晓晔 on 2017/5/5.
//  Copyright © 2017年 孙晓晔. All rights reserved.
//

#import "LoginView.h"

@implementation LoginView


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
    
    CGContextRef context = UIGraphicsGetCurrentContext();
//    CGContextSetLineWidth(context, 1);
    CGContextSetStrokeColorWithColor(context, [UIColor grayColor].CGColor);
////    CGContextAddRect(context, CGRectMake(65, 125, 270, 85));
//    
//    CGContextAddEllipseInRect(context, CGRectMake(65, 125, 270, 85))
//    CGContextStrokePath(context);
    
    [self drawRoundRectInContext:context withRect:CGRectMake(45, 125, 275, 85)];
    
    
}
-(void)drawRoundRectInContext:(CGContextRef)context withRect:(CGRect)rect{
    
    
    CGContextSetLineWidth(context, 1.5);
//    CGContextSetStrokeColorWithColor(context, [UIColor groupTableViewBackgroundColor].CGColor);
    CGContextSetStrokeColorWithColor(context, [UIColor grayColor].CGColor);
    
//    CGContextSetStrokeColorWithColor(context, [UIColor greenColor].CGColor);
    UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:10];
    
    CGContextAddPath(context, bezierPath.CGPath);
    CGContextStrokePath(context);
    
    CGFloat minx = CGRectGetMinX(rect);
    CGFloat maxx = CGRectGetMaxX(rect);
    
    CGFloat midy = CGRectGetMidY(rect);
    
    CGContextMoveToPoint(context, minx, midy);
    CGContextAddLineToPoint(context, maxx, midy);
    
    CGContextStrokePath(context);
}

@end
